import datetime
from applications.extensions import db


class PostCollections(db.Model):
    __tablename__ = 'post_collection'

    uid = db.Column(db.Integer,nullable=False, comment='用户id', primary_key=True)
    post_id = db.Column(db.Integer, nullable=False, comment='帖子id', primary_key=True)

    def to_dict(self):
        """将帖子实例转换为字典"""
        return {
            'uid': self.uid,
            'postId': self.post_id,
        }
